package com.atguigu.p1;

public class Bank {

	//属性
	private Customer customer[] = new Customer[10];//客户数组，存放客户
	private int numberofcustomer;//客户数
	
	//构造器
	public Bank()
	{
	 //customer = new Customer[10];//造10个客户
	}
	
	//添加客户
	public void addCustomer(String f,String l)
	{
		//创建客户对象
		Customer cust = new Customer(f,l);
//		customer[numberofcustomer] = cust;
//		numberofcustomer++;
		//或
		customer[numberofcustomer++] = cust;//将创建好的客户存放到客户数组中
	}
	
	//获取客户个数
	public int getNumberOfCustomer()
	{
		return numberofcustomer;
	}
	
	//获取指定位置上的客户
	public Customer getCustomer(int index)
	{
		if(index >=0 && index < numberofcustomer)
		{
			return customer[index];
		}
		else
		{
			return null;
		}
	}
}
